Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next

Event Kinds

Enumerators of type EventKind specify the kind of event described by an event record or posted with PPostEvent (PPostEvent) or PostEvent (PostEvent) .

typedef UInt16 EventKind;   /* event kinds */
enum {
    /* event codes */
    nullEvent               = 0,        /* no other pending events */
    mouseDown               = 1,        /* mouse button pressed */
    mouseUp                 = 2,        /* mouse button released */
    keyDown                 = 3,        /* key pressed */
    keyUp                   = 4,        /* key released */
    autoKey                 = 5,        /* key repeatedly held down */
    updateEvt               = 6,        /* window needs updating */
    diskEvt                 = 7,        /* disk inserted */
    activateEvt             = 8,        /* activate/deactivate window */
    osEvt                   = 15        /* operating-system event
                                        /* (suspend, resume, or
                                        /* mouse-moved) */
    kHighLevelEvent         = 23        /* high-level event */
    /*message codes for operating-system events */
    mouseMovedMessage       = 0x00FA,   /* mouse-moved event */
    suspendResumeMessage    = 0x0001,   /* suspend or resume event */
    /*flags for suspend and resume events */
    resumeFlag              = 1,        /* resume event */
    convertClipboardFlag    = 2,        /* Clipboard conversion
                                        /* required */
};

Enumerator descriptions

nullEvent
The event code indicating that there are no other pending events.
mouseDown
The event code indicating that the mouse button has been pressed.
mouseUp
The event code indicating that the mouse button has been released.
keyDown
The event code indicating that a key has been pressed.
keyUp
The event code indicating that a key has been released.
autoKey
The event code indicating that a key has been repeatedly held down.
updateEvt
The event code indicating that a window needs updating.
diskEvt
The event code indicating that a disk has been inserted.
activateEvt
The event code indicating that a window has been activated or deactivated.
osEvt
The event code indicating a suspend, resume, or mouse-moved operating-system event.
kHighLevelEvent
A high-level event.
mouseMovedMessage The message code indicating the mouse-moved operating-system event.
 
suspendResumeMessage
The message code indicating a suspend or resume operating-system event.
resumeFlag
Flag for a resume event.
convertClipboardFlag

Note that in System 7, event kinds with the values 9 through 14 are undefined and reserved for future use by Apple. All other values for the what field are also reserved for use by Apple.

For information about the use of these enumerators in the event record, see "The Event Record" .


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next